import React, { Component } from 'react'
// 定义路由规则
import { Routes, Route, Link, NavLink, Navigate } from 'react-router-dom'//v5
import Home from '../views/base/home'
import Homeindex from '../views/base/children/index/index'
import Homeactivity from '../views/base/children/activity/index'
import Hometobook from '../views/base/children/tobook/index'
import Other_page from '../views/other_page/home'
import Other_pageVideodetail from '../views/other_page/children/video_detail/index'
import Other_pagetest from '../views/other_page/children/test/index'

/*
[  @router  ]
*/
var routers = (
    <>
        <Routes data-router>
            <Route path="/" element={<Navigate to="/home/index" replace={true} key="navi" />}></Route>
            <Route path="/home" element={<Navigate to="/home/index" replace={true} key="navi" />}></Route>
            <Route path="*" element={<Navigate to="/other_page/test" replace={true} key="navi" />}></Route>
            <Route path="/other_page" element={<Navigate to="/other_page/test" replace={true} key="navi" />}></Route>
            {/* // */}
            <Route path="/home" element={< Home key="home" />}>
                <Route path='index' element={<Homeindex key="Homeindex" />}></Route>
                <Route path='activity' element={<Homeactivity key="Homeactivity" />}></Route>
                <Route path='tobook' element={<Hometobook key="Hometobook" />}></Route>
            </Route>
            <Route path="/other_page" element={< Other_page key="other_page" />}>
                <Route path='videodetail' element={<Other_pageVideodetail key="Other_pageVideodetail" />}></Route>
                <Route path='test' element={<Other_pagetest key="Other_pagetest" />}></Route>
            </Route>
        </Routes >
    </>
)
/*
[  router  ]
*/
export default () => {
    return routers
}